# -*- coding: utf-8 -*-
import cx_Oracle
con = cx_Oracle.connect('gis/ndtvgis@192.168.20.79/GIS')
# print con.version
cursor = con.cursor()
 
    
cursor.execute("select sum(gdcd) from tegdd t")
for result in cursor:
    print u'统计管道段长度:',result[0]
    

cursor.execute("select count(*) from tersj")
for result in cursor:
    print u'统计人手井数量:',result[0]

cursor.execute("select count(*) from tegjd")
for result in cursor:
    print u'统计光节点数量:',result[0]

cursor.execute("SELECT count(*) FROM tegld where id0 in (SELECT glid FROM tegljg  group by glid  having count(*)>4)")
for result in cursor:
    print u'查询有光缆路由的光缆段数量(>4):',result[0]

    
cursor.close()
con.close()